package com.jeesite.modules.rc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.rc.entity.RcPerson;
import com.jeesite.modules.rc.dao.RcPersonDao;

/**
 * 人才表Service
 * @author ccz
 * @version 2025-03-24
 */
@Service
public class RcPersonService extends CrudService<RcPersonDao, RcPerson> {
	@Autowired
	private RcPersonDao rcPersonDao;

	/**
	 * 获取单条数据
	 * @param rcPerson
	 * @return
	 */
	@Override
	public RcPerson get(RcPerson rcPerson) {
		return super.get(rcPerson);
	}
	
	/**
	 * 查询分页数据
	 * @param rcPerson 查询条件
	 * @param rcPerson.page 分页对象
	 * @return
	 */
	@Override
	public Page<RcPerson> findPage(RcPerson rcPerson) {
		return super.findPage(rcPerson);
	}
	
	/**
	 * 查询列表数据
	 * @param rcPerson
	 * @return
	 */
	@Override
	public List<RcPerson> findList(RcPerson rcPerson) {
		return super.findList(rcPerson);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param rcPerson
	 */
	@Override
	@Transactional
	public void save(RcPerson rcPerson) {
		super.save(rcPerson);
	}
	
	/**
	 * 更新状态
	 * @param rcPerson
	 */
	@Override
	@Transactional
	public void updateStatus(RcPerson rcPerson) {
		super.updateStatus(rcPerson);
	}
	
	/**
	 * 删除数据
	 * @param rcPerson
	 */
	@Override
	@Transactional
	public void delete(RcPerson rcPerson) {
		super.delete(rcPerson);
	}

    public List<RcPerson> findPersonData(RcPerson rcPerson) {
		if (rcPerson.getRcJiguan()==null||rcPerson.getRcJiguan()==""){
			return super.findList(rcPerson);
		}
		return rcPersonDao.findPersonData(rcPerson.getRcJiguan());
    }
}